<!DOCTYPE html>
<html lang="en">

<head>
 <meta charset="UTF-8">
 <meta name="viewport"
  content="width=device-width, initial-scale=1.0, minimum-scale=1,maximum-scale=1,user-scalable=no">
 <meta http-equiv="X-UA-Compatible" content="ie=edge">
 <title data-ch="恐龙探险" data-en="Dinosaur Adventure" class="document_title">恐龙探险</title>
 <script src="js/jquery-3.3.1.min.js"></script>
 <script src="js/common.js"></script>
 <script src="js/rem.js"></script>
 <script src="js/layer.js"></script>
 <script type="text/javascript">
  isLogin();
 </script>
 <link rel="stylesheet" href="css/common.css">
 <link rel="stylesheet" href="css/index.css">
</head>

<body>
 <!--头部-->
 <div class=" jui_top_bar">
  <a class="jui_top_left" href="javascript:history.back(-1)"><img src="icons/back.png"></a>
  <div class="jui_top_middle font_weight" data-ch="套现" data-en="Cash out">套现</div>
 </div>
 <!-- 头部end -->
 <!-- 主体部分开始 -->
 <div class="zhuan_jirou_box jui_main col_fff">
  <div class="zhuan_jirou border_radius05 padding_032 latout_mask">
   <div class="f32 text_center taoxian_totle">0.00</div>
   <div class="f28 text_center opacity_09 zhuan_jirou_zong col_fff" data-ch="收益总值" data-en="Total income">收益总值</div>
   <div class="f28 flex_ce">
    <div class="zhuan_jirou_deng text_center col_fff" data-ch="1收益=RM 1" data-en="1 income=1 meat">1收益=RM1</div>
    <img class="zhuan_jirou_meat" style="width:0.6rem; margin-left:0.2rem" src="./icons/money.png" alt="">
   </div>

   <div class="zhuan_jirou_pass">
    <div class="f30 col_fff" data-ch="套现数量" data-en="Cash out amount">套现数量</div>
    <input id="taoxian_num" type="text" data-ch="至少套现100以上" data-en="Cash at least 100" placeholder="至少套现100以上">
   </div>

   <div class="zhuan_jirou_pass">
    <div class="f30 col_fff" data-ch="请输入交易密码" data-en="Please enter secondary password">请输入交易密码</div>
    <input id="taoxian_pass" type="password">
   </div>
   <div class="zhuan_jirou_btn col_fff border_radius05 text_center" data-ch="确认" data-en="Confirm">确认</div>
  </div>
  
 </div>

 <script>
  $(function(){
   // 获取可套现的总额
   let data1 = {
    uid: localStorage.getItem("u_id"),
    token: localStorage.getItem("token"),
    language_type: localStorage.getItem("language_type"),
    l_type: 3
   }
   $.ajax({
    type: 'post',
    url: baseURL + '/index.php?m=index&c=wallet_log',
    data: data1,
    success: function success(data) {
     data = JSON.parse(data);
	 is_login(data);
     if (data.code == 1) {
     $(".taoxian_totle").html(Number(data.user.m_credit_3).toFixed(2))
     
     } else {
      box_timer(data.msg);
     }
    }
   })

   $(".zhuan_jirou_btn").click(function () {
    if($("#taoxian_num").val() < 100){
     box_timer(localStorage.getItem("language_type") == 1 ? '至少套现100以上' : 'Cash at least 100')
    }else{
     var data = {
      uid: localStorage.getItem("u_id"),
      token: localStorage.getItem("token"),
      language_type: localStorage.getItem("language_type"),
      t_money: $("#taoxian_num").val(),
      m_pass: $("#taoxian_pass").val()
     }
     $.ajax({
      type: 'post',
      url: baseURL + '/index.php?m=user&c=drawing',
      data: data,
      success: function success(data){
       data = JSON.parse(data);
       is_login(data);
       box_timer(data.msg);
       if(data.code == 1){
        setTimeout(function(){
         window.history.go(-1) // 返回上一页
        },1500)
       }
      }
     })
    }
    
   })

   language();
   documentName()
  })
  
 </script>
</body>

</html>